import datetime
from applications.extensions import db


class WikiDict(db.Model):
    __tablename__ = "pest_dict"
    id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment='数据字典ID')
    disease_name = db.Column(db.String(100), nullable=False, comment="病名编码")
    wiki_dname = db.Column(db.String(100), nullable=False, comment="病名")

    create_at = db.Column(db.DateTime, default=datetime.datetime.now, comment='创建时间')
    update_at = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='更新时间')

    def __init__(self, disease_name, wiki_dname):
        self.disease_name = disease_name
        self.wiki_dname = wiki_dname